package com.ldy.question;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * <br>
 * 版权: Copyright (c) 2011-2018<br>
 * 公司: 活力天汇<br>
 *
 * @author: 刘德咏<br>
 * @date: 2018-04-19<br>
 */
public class TestQuestion {

    @Test
    public void testReserve() {
        String abc = "skjfljd";
        System.out.println(reserve(abc));
    }

    public void testLamda() {

    }

    public String reserve(String oldStr) {
        char[] chars = oldStr.toCharArray();
        StringBuffer sb = new StringBuffer();
        for (int i=oldStr.length()-1; i>-1; i--) {
            sb.append(chars[i]);
        }
        return sb.toString();
    }

    public List<String> intToString(List<Integer> lists) {
        List<String> collect = lists.stream().map(list -> String.valueOf(list)).collect(Collectors.toList());
        return collect;
    }
}
